package com.itheima.mapper;

import com.itheima.pojo.Dish;
import com.itheima.pojo.DishFlavor;
import com.itheima.vo.PhoneDishFlavorVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author YangJiaHao
 */
@Mapper
public interface DishMapper {

    // List<Dish> getList(String categoryId);

    List<Dish> page(@Param("name") String name, @Param("start") Integer start,
                       @Param("pageSize")Integer pageSize, @Param("type")Integer type);

    Long countDish(@Param("type") Integer type);

    Integer insert(@Param("dish") Dish dish);

    Integer insertFlavor(@Param("list") List<DishFlavor> list);

    Integer insertFlavor1(@Param("dishFlavor") DishFlavor dishFlavor);

    Integer updateById(@Param("dish") Dish dish);

    Integer countFlavorByDishId(@Param("dishId") String dishId);

    Integer removeFlavorByDishId(@Param("dishId") String dishId);

    Dish selectDishById(@Param("id") String id);

    List<DishFlavor> selectflavorsById(@Param("id") String id);

    String selectCategoryNameByCategoryId(@Param("id") String id);

    Integer deleteDishById(@Param("ids") String[] ids);

    Integer deleteFlavorById(@Param("ids") String[] ids);

    Integer updateStatus(@Param("status") Integer status,@Param("ids") String[] ids);

    List<Dish> selectDishs(@Param("categoryId") String categoryId);

    List<DishFlavor> selectFlavors(@Param("id") String id);

    List<PhoneDishFlavorVo> selectPhoneflavorsByDishId(String id);

    Long count(@Param("categoryId")String categoryId,@Param("status") Integer status);

    List<Dish> DishList(@Param("categoryId") String categoryId, @Param("status") Integer status);
}
